<%@ page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %>

<link rel="stylesheet" href="${pageContext.request.contextPath}/common/assets/css/material-kit.css">
<link rel="stylesheet" href="${pageContext.request.contextPath}/common/assets/css/material-dashboard.min.css">

<!-- Core JS Files -->
<script src="${pageContext.request.contextPath}/common/assets/js/core/jquery.min.js"></script>
<script src="${pageContext.request.contextPath}/common/assets/js/core/popper.min.js"></script>
<script src="${pageContext.request.contextPath}/common/assets/js/bootstrap-material-design.js"></script>
<script src="${pageContext.request.contextPath}/common/bootstrap-3.3.7/js/jquery.qrcode.min.js"></script>

<!-- Plugin for pagination-->
<script src="${pageContext.request.contextPath}/common/assets/js/plugins/jquery.pagination.min.js"></script>

<!-- Plugin for Date Time Picker and Full Calendar Plugin-->
<script src="${pageContext.request.contextPath}/common/assets/js/plugins/moment.min.js"></script>

<!-- Plugin for Select, full documentation here: http://silviomoreto.github.io/bootstrap-select -->
<script src="${pageContext.request.contextPath}/common/assets/js/plugins/bootstrap-selectpicker.js"></script>

<!-- Plugin for Tags, full documentation here: http://xoxco.com/projects/code/tagsinput/ -->
<script src="${pageContext.request.contextPath}/common/assets/js/plugins/bootstrap-tagsinput.js"></script>

<!-- Plugin for Fileupload, full documentation here: http://www.jasny.net/bootstrap/javascript/#fileinput -->
<script src="${pageContext.request.contextPath}/common/assets/js/plugins/jasny-bootstrap.min.js"></script>

<!-- Plugin for Small Gallery in Product Page -->
<script src="${pageContext.request.contextPath}/common/assets/js/plugins/jquery.flexisel.js"></script>

<!-- Plugin for the Datepicker, full documentation here: https://github.com/Eonasdan/bootstrap-datetimepicker -->
<script src="${pageContext.request.contextPath}/common/assets/js/plugins/bootstrap-datetimepicker.min.js"></script>

<!-- Plugin for the Sliders, full documentation here: http://refreshless.com/nouislider/ -->
<script src="${pageContext.request.contextPath}/common/assets/js/plugins/nouislider.min.js"></script>

<script src="${pageContext.request.contextPath}/common/assets/js/plugins/bootstrap-notify.js"></script>

<!-- Material Kit Core initialisations of plugins and Bootstrap Material Design Library -->
<script src="${pageContext.request.contextPath}/common/assets/js/material-kit.js?v=2.0.0"></script>

<!-- Fonts and icons -->
<link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/common/bootstrap-3.3.7/css/googleapis-css.css"/>
<link rel="stylesheet" href="${pageContext.request.contextPath}/common/bootstrap-3.3.7/css/font-awesome.min.css"/>

<link rel="stylesheet" href="${pageContext.request.contextPath}/css/common-css.css"/>
<script src="${pageContext.request.contextPath}/common/assets/js/plugins/clipboard.min.js"></script>



<script>
    var baseUrl = {

        //测试服务器
        // var apiDomain = 'http://119.23.232.192:8081/bocai-sales';
//          正式服务器
//         var apiDomain = 'http://sbet.gowin.co.ke/bocai-sales';
//          k 本地服务器
//         var apiDomain = 'http://172.21.40.189:8080/bocai-sales';

        base: 'http://localhost:8080/bocai-sale/',
        tempHeadImg: 'http://testxrtn.ggling.com/children/frontend/web/uploads/img/2018-03-14/20180314172404.png'
    }

    var baseFn = {
        getQueryString: function (name) {
            var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)");
            var r = window.location.search.substr(1).match(reg);
            if (r != null)return decodeURI(r[2]);
            return null;
        },
    }
    function valueOfNull(string) {
        if (null == string)
            return '';

        return string;
    }

    function valueOfNull(string, value) {
        if (null == string)
            return value;

        return string;
    }

    function valueOfNullthree(string, value) {
        if (null == string || string.length == 0)
            return value;
        return string;
    }


    function timestampToTime(timestamp) {
        if (timestamp == null) {
            return "";
        } else {
            var date = new Date(timestamp);//时间戳为10位需*1000，时间戳为13位的话不需乘1000
            Y = date.getFullYear() + '-';
            M = (date.getMonth() + 1 < 10 ? '0' + (date.getMonth() + 1) : date.getMonth() + 1) + '-';
            D = (date.getDate() < 10 ? '0' + (date.getDate() ) : date.getDate()) + ' ';
            h = (date.getHours() < 10 ? '0' + (date.getHours() ) : date.getHours()) + ':';
            m = (date.getMinutes() < 10 ? '0' + (date.getMinutes() ) : date.getMinutes()) + ':';
            s = date.getSeconds() < 10 ? '0' + (date.getSeconds() ) : date.getSeconds();
            return Y + M + D + h + m + s;
        }
    };

    function dateToYMD(date) {
        if (date == null) {
            return "";
        } else {
            Y = date.getFullYear() + '-';
            M = (date.getMonth() + 1 < 10 ? '0' + (date.getMonth() + 1) : date.getMonth() + 1) + '-';
            D = (date.getDate() < 10 ? '0' + (date.getDate() ) : date.getDate());
            return Y + M + D;
        }
    };

    function showNotification(from, align, messageInfo) {
        var type = ['', 'info', 'danger', 'success', 'warning', 'rose', 'primary'];
        var color = Math.floor((Math.random() * 6) + 1);
        $.notify({
            message: messageInfo
        }, {
            type: type[color],
            timer: 2000,
            placement: {
                from: from,
                align: align
            }
        });
    }

</script>